/*
 * Copyright (C) 2016 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See http://www.gnu.org/licenses/gpl-2.0.html for more details.
 */

#include "mtk_cpufreq_config.h"
#include "mtk_cpufreq_platform.h"

#define NR_FREQ		16
#define ARRAY_COL_SIZE	4

static unsigned int FY_6853Tbl[NR_FREQ * NR_MT_CPU_DVFS][ARRAY_COL_SIZE] = {
	/* Freq, Vproc, post_div, clk_div */
	/* LL */
	{ 2000, 96, 1, 1 },
	{ 1916, 92, 1, 1 },
	{ 1812, 87, 1, 1 },
	{ 1750, 84, 1, 1 },
	{ 1645, 79, 2, 1 },
	{ 1500, 72, 2, 1 },
	{ 1393, 68, 2, 1 },
	{ 1287, 64, 2, 1 },
	{ 1128, 58, 2, 1 },
	{ 1048, 55, 2, 1 },
	{ 968, 52, 2, 1 },
	{ 862, 48, 2, 1 },
	{ 756, 44, 4, 1 },
	{ 703, 42, 4, 1 },
	{ 650, 40, 4, 1 },
	{ 500, 40, 4, 1 },

	/* L */
	{ 2210, 96, 1, 1 },
	{ 2093, 91, 1, 1 },
	{ 2000, 87, 1, 1 },
	{ 1906, 83, 1, 1 },
	{ 1790, 78, 1, 1 },
	{ 1720, 75, 1, 1 },
	{ 1650, 72, 2, 1 },
	{ 1534, 68, 2, 1 },
	{ 1418, 64, 2, 1 },
	{ 1274, 59, 2, 1 },
	{ 1129, 54, 2, 1 },
	{ 1042, 51, 2, 1 },
	{ 985, 49, 2, 1 },
	{ 898, 46, 2, 1 },
	{ 840, 44, 4, 1 },
	{ 725, 40, 4, 1 },

	/* CCI */
	{ 1400, 96, 2, 1 },
	{ 1356, 93, 2, 1 },
	{ 1254, 86, 2, 1 },
	{ 1152, 79, 2, 1 },
	{ 1108, 76, 2, 1 },
	{ 1050, 72, 2, 1 },
	{ 975, 68, 2, 1 },
	{ 900, 64, 2, 1 },
	{ 825, 60, 2, 1 },
	{ 768, 57, 4, 1 },
	{ 675, 52, 4, 1 },
	{ 600, 48, 4, 1 },
	{ 562, 46, 4, 1 },
	{ 525, 44, 4, 1 },
	{ 487, 42, 4, 1 },
	{ 450, 40, 4, 1 },
};

static unsigned int MT6853_6853Tbl[NR_FREQ * NR_MT_CPU_DVFS][ARRAY_COL_SIZE] = {
	/* Freq, Vproc, post_div, clk_div */
	/* LL */
	{ 2000, 96, 1, 1 },
	{ 1916, 92, 1, 1 },
	{ 1812, 87, 1, 1 },
	{ 1750, 84, 1, 1 },
	{ 1645, 79, 2, 1 },
	{ 1500, 72, 2, 1 },
	{ 1393, 68, 2, 1 },
	{ 1287, 64, 2, 1 },
	{ 1128, 58, 2, 1 },
	{ 1048, 55, 2, 1 },
	{ 968, 52, 2, 1 },
	{ 862, 48, 2, 1 },
	{ 756, 44, 4, 1 },
	{ 703, 42, 4, 1 },
	{ 650, 40, 4, 1 },
	{ 500, 40, 4, 1 },

	/* L */
	{ 2000, 86, 1, 1 },
	{ 1953, 84, 1, 1 },
	{ 1906, 82, 1, 1 },
	{ 1836, 79, 1, 1 },
	{ 1790, 78, 1, 1 },
	{ 1720, 75, 1, 1 },
	{ 1650, 72, 2, 1 },
	{ 1534, 68, 2, 1 },
	{ 1418, 64, 2, 1 },
	{ 1274, 59, 2, 1 },
	{ 1129, 54, 2, 1 },
	{ 1042, 51, 2, 1 },
	{ 985, 49, 2, 1 },
	{ 898, 46, 2, 1 },
	{ 840, 44, 4, 1 },
	{ 725, 40, 4, 1 },

	/* CCI */
	{ 1400, 96, 2, 1 },
	{ 1356, 93, 2, 1 },
	{ 1254, 86, 2, 1 },
	{ 1152, 79, 2, 1 },
	{ 1108, 76, 2, 1 },
	{ 1050, 72, 2, 1 },
	{ 975, 68, 2, 1 },
	{ 900, 64, 2, 1 },
	{ 825, 60, 2, 1 },
	{ 768, 57, 4, 1 },
	{ 675, 52, 4, 1 },
	{ 600, 48, 4, 1 },
	{ 562, 46, 4, 1 },
	{ 525, 44, 4, 1 },
	{ 487, 42, 4, 1 },
	{ 450, 40, 4, 1 },
};

static unsigned int MT6853_B24GTbl[NR_FREQ * NR_MT_CPU_DVFS][ARRAY_COL_SIZE] = {
	/* Freq, Vproc, post_div, clk_div */
	/* LL */
	{ 2000, 96, 1, 1 },
	{ 1916, 92, 1, 1 },
	{ 1812, 87, 1, 1 },
	{ 1750, 84, 1, 1 },
	{ 1645, 79, 2, 1 },
	{ 1500, 72, 2, 1 },
	{ 1393, 68, 2, 1 },
	{ 1287, 64, 2, 1 },
	{ 1128, 58, 2, 1 },
	{ 1048, 55, 2, 1 },
	{ 968, 52, 2, 1 },
	{ 862, 48, 2, 1 },
	{ 756, 44, 4, 1 },
	{ 703, 42, 4, 1 },
	{ 650, 40, 4, 1 },
	{ 500, 40, 4, 1 },

	/* L */
	{ 2400, 96, 1, 1 },
	{ 2306, 93, 1, 1 },
	{ 2210, 90, 1, 1 },
	{ 2118, 87, 1, 1 },
	{ 1993, 83, 1, 1 },
	{ 1837, 78, 1, 1 },
	{ 1650, 72, 2, 1 },
	{ 1534, 68, 2, 1 },
	{ 1418, 64, 2, 1 },
	{ 1274, 59, 2, 1 },
	{ 1129, 54, 2, 1 },
	{ 1042, 51, 2, 1 },
	{ 985, 49, 2, 1 },
	{ 898, 46, 2, 1 },
	{ 840, 44, 4, 1 },
	{ 725, 40, 4, 1 },

	/* CCI */
	{ 1400, 96, 2, 1 },
	{ 1356, 93, 2, 1 },
	{ 1254, 86, 2, 1 },
	{ 1152, 79, 2, 1 },
	{ 1108, 76, 2, 1 },
	{ 1050, 72, 2, 1 },
	{ 975, 68, 2, 1 },
	{ 900, 64, 2, 1 },
	{ 825, 60, 2, 1 },
	{ 768, 57, 4, 1 },
	{ 675, 52, 4, 1 },
	{ 600, 48, 4, 1 },
	{ 562, 46, 4, 1 },
	{ 525, 44, 4, 1 },
	{ 487, 42, 4, 1 },
	{ 450, 40, 4, 1 },
};

static unsigned int MT6853_B26GTbl[NR_FREQ * NR_MT_CPU_DVFS][ARRAY_COL_SIZE] = {
	/* Freq, Vproc, post_div, clk_div */
	/* LL */
	{ 2000, 96, 1, 1 },
	{ 1916, 92, 1, 1 },
	{ 1812, 87, 1, 1 },
	{ 1750, 84, 1, 1 },
	{ 1645, 79, 2, 1 },
	{ 1500, 72, 2, 1 },
	{ 1393, 68, 2, 1 },
	{ 1287, 64, 2, 1 },
	{ 1128, 58, 2, 1 },
	{ 1048, 55, 2, 1 },
	{ 968, 52, 2, 1 },
	{ 862, 48, 2, 1 },
	{ 756, 44, 4, 1 },
	{ 703, 42, 4, 1 },
	{ 650, 40, 4, 1 },
	{ 500, 40, 4, 1 },

	/* L */
	{ 2600, 96, 1, 1 },
	{ 2362, 90, 1, 1 },
	{ 2210, 86, 1, 1 },
	{ 2085, 83, 1, 1 },
	{ 1887, 78, 1, 1 },
	{ 1768, 75, 1, 1 },
	{ 1650, 72, 2, 1 },
	{ 1534, 68, 2, 1 },
	{ 1418, 64, 2, 1 },
	{ 1274, 59, 2, 1 },
	{ 1129, 54, 2, 1 },
	{ 1042, 51, 2, 1 },
	{ 985, 49, 2, 1 },
	{ 898, 46, 2, 1 },
	{ 840, 44, 4, 1 },
	{ 725, 40, 4, 1 },

	/* CCI */
	{ 1400, 96, 2, 1 },
	{ 1356, 93, 2, 1 },
	{ 1254, 86, 2, 1 },
	{ 1152, 79, 2, 1 },
	{ 1108, 76, 2, 1 },
	{ 1050, 72, 2, 1 },
	{ 975, 68, 2, 1 },
	{ 900, 64, 2, 1 },
	{ 825, 60, 2, 1 },
	{ 768, 57, 4, 1 },
	{ 675, 52, 4, 1 },
	{ 600, 48, 4, 1 },
	{ 562, 46, 4, 1 },
	{ 525, 44, 4, 1 },
	{ 487, 42, 4, 1 },
	{ 450, 40, 4, 1 },
};

unsigned int *xrecordTbl[NUM_CPU_LEVEL] = {
	[CPU_LEVEL_0] = &FY_6853Tbl[0][0],
	[CPU_LEVEL_1] = &MT6853_6853Tbl[0][0],
	[CPU_LEVEL_2] = &MT6853_6853Tbl[0][0],
	[CPU_LEVEL_3] = &MT6853_B24GTbl[0][0],
	[CPU_LEVEL_4] = &MT6853_B24GTbl[0][0],
	[CPU_LEVEL_5] = &MT6853_B26GTbl[0][0],
	[CPU_LEVEL_6] = &MT6853_B26GTbl[0][0],
};

#ifdef CCI_MAP_TBL_SUPPORT
static unsigned char CCI_FYTbl[32][16] = {
	/* Normal CCI Map */
	{ 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 4, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7},
	{ 4, 5, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7},
	{ 4, 5, 6, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 14, 14, 14},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},


	/* Perf CCI Map */
	{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
	{ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
	{ 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
	{ 0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
	{ 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 12, 12, 12, 12, 12},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 13, 13, 13, 13},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 14, 14, 14},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
};

static unsigned char CCI_MT6853Tbl[32][16] = {
	/* Normal CCI Map */
	{ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6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 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 12, 12, 12, 12, 12},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 13, 13, 13, 13},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 14, 14, 14},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 1, 1, 2, 2, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
};

static unsigned char CCI_B24GTbl[32][16] = {
	/* Normal CCI Map */
	{ 3, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 3, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 3, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7},
	{ 3, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7},
	{ 3, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8},
	{ 3, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9},
	{ 3, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10},
	{ 3, 3,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, 12, 13, 14, 14, 14, 14},
	{ 0, 0, 0, 0, 0, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 0, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 0, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 0, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 0, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
};

static unsigned char CCI_B26GTbl[32][16] = {
	/* Normal CCI Map */
	{ 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7},
	{ 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7},
	{ 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 14, 14},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15},

	/* Perf CCI Map */
	{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
	{ 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
	{ 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
	{ 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
	{ 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 6, 6, 6, 6, 6, 6, 6, 6},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 12, 12, 12, 12, 12},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 13, 13, 13, 13, 13},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 13, 14, 14, 14, 14},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
	{ 0, 0, 0, 0, 1, 2, 3, 5, 10, 11, 12, 13, 14, 15, 15, 15},
};

static unsigned char enratio_FYTbl[(NR_FREQ + 1) * IMAX_EN_RATIO_TBL_NUM] = {
	5, 22, 23, 25, 26, 28, 30, 0, 0,
	    0,  0,  0,  0,  0,  0, 0, 0,
	5, 22, 23, 25, 26, 28, 30, 0, 0,
	    0,  0,  0,  0,  0,  0, 0, 0,
};

unsigned char *xrecord_IMAX_Tbl[NUM_CPU_LEVEL] = {
	[CPU_LEVEL_0] = enratio_FYTbl,
	[CPU_LEVEL_1] = enratio_FYTbl,
	[CPU_LEVEL_2] = enratio_FYTbl,
	[CPU_LEVEL_3] = enratio_FYTbl,
	[CPU_LEVEL_4] = enratio_FYTbl,
	[CPU_LEVEL_5] = enratio_FYTbl,
	[CPU_LEVEL_6] = enratio_FYTbl,
};
unsigned char *xrecord_CCI_Tbl[NUM_CPU_LEVEL] = {
	[CPU_LEVEL_0] = &CCI_FYTbl[0][0],
	[CPU_LEVEL_1] = &CCI_MT6853Tbl[0][0],
	[CPU_LEVEL_2] = &CCI_MT6853Tbl[0][0],
	[CPU_LEVEL_3] = &CCI_B24GTbl[0][0],
	[CPU_LEVEL_4] = &CCI_B24GTbl[0][0],
	[CPU_LEVEL_5] = &CCI_B26GTbl[0][0],
	[CPU_LEVEL_6] = &CCI_B26GTbl[0][0],
};
#endif
